import json
import os

def updb():
    path = r"./花园花朵结构.json"
    fi = open(path,'r',encoding='utf8')
    fo = open(r'./newjson.json', 'w', encoding='utf8')
    olist = []
    for item in fi:

        itemobj = json.loads(item)

        del itemobj['date']

        itemobj['_id'] = int(itemobj['_id'][:-2])

        itemobj['zm_Id'] = ''

        itemobj['jw_Id'] = ''

        j = 0

        for wrItem in itemobj['wrapper']:
            wrItem['title'] = wrItem['name']
            del itemobj['wrapper'][j]['name']
            itemobj['wrapper'][j]['videoUrl'] = ''
            j = j + 1

        wrItem = itemobj['wrapper']

        del wrItem[0]

        del wrItem[2]

        itemobj['wrapper'] = wrItem

        print(itemobj)

        olist.append(itemobj)

        fo.write(json.dumps(itemobj, ensure_ascii=False) + '\n')


    fi.close()
    fo.close()

updb()